package(default_visibility = ["//visibility:public"])

load("@io_bazel_rules_sass//:defs.bzl", "sass_binary", "sass_library")
load("@npm_angular_bazel//:index.bzl", "protractor_web_test_suite")
load("//tools:defaults.bzl", "ng_e2e_test_library", "ng_module")

ng_module(
    name = "mdc-chips",
    srcs = glob(
        ["**/*.ts"],
        exclude = ["**/*.spec.ts"],
    ),
    assets = [":chips_scss"] + glob(["**/*.html"]),
    module_name = "@angular/material-experimental/mdc-chips",
    deps = [
        "//src/material/core",
        "@npm//@angular/common",
        "@npm//@angular/core",
        "@npm//material-components-web",
    ],
)

sass_library(
    name = "mdc_chips_scss_lib",
    srcs = glob(["**/_*.scss"]),
    deps = [
        "//src/material-experimental/mdc-helpers:mdc_helpers_scss_lib",
        "//src/material-experimental/mdc-helpers:mdc_scss_deps_lib",
        "//src/material/core:core_scss_lib",
    ],
)

sass_binary(
    name = "chips_scss",
    src = "chips.scss",
    include_paths = [
        "external/npm/node_modules",
    ],
    deps = [
        "//src/material-experimental/mdc-helpers:mdc_scss_deps_lib",
        "//src/material/core:all_themes",
    ],
)

ng_e2e_test_library(
    name = "e2e_test_sources",
    srcs = glob(["**/*.e2e.spec.ts"]),
    deps = [
        "//src/cdk/testing/e2e",
    ],
)

protractor_web_test_suite(
    name = "e2e_tests",
    configuration = "//src/e2e-app:protractor.conf.js",
    data = [
        "//tools/axe-protractor",
        "@npm//@angular/bazel",
    ],
    on_prepare = "//src/e2e-app:start-devserver.js",
    server = "//src/e2e-app:devserver",
    tags = ["e2e"],
    deps = [
        ":e2e_test_sources",
        "//src/cdk/testing/e2e",
    ],
)
